﻿
using System;
using System.Collections.Generic;
using System.Data.Common;

namespace Yidu.Persister
{
	/// <summary>
	/// Description of IDao.
	/// </summary>
	public interface IDao
	{
		int Save(object entry);

		T Load<T>(params NaVa[] paramObjects);

        List<T> List<T>(params NaVa[] paramObjects);
        
	    T Load<T>(object primaryKey);

        int Update(object entry);

        int Delete(object entry);

	    void Begin();

	    void Commit();

	    void Rollback();
		
    	List<Dictionary<string, object>> List(string sqlKeyOrText,bool dynamicSql ,params object[] paramObjects);

        List<Dictionary<string, object>> ListByProperty(string sqlKeyOrText, bool dynamicSql, params NaVa[] paramObjects);
	}
}
